package cc.comac.mom.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.QualityTestContentService;
import cc.comac.mom.bean.QualityTestContent;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/QualityTestContent")
public class QualityTestContentController {
	
	@Autowired
	private QualityTestContentService qualityTestContentService;

	
	@ApiOperation("新增实验内容")
	@RequestMapping(value = "/insert",method = RequestMethod.POST)
	public ResultBean insert(@RequestBody QualityTestContent obj) {
		return qualityTestContentService.insert(obj);
	}
	
	@ApiOperation("查询实验内容带分页")
	@RequestMapping(value = "/selectByCondition",method = RequestMethod.POST)
	public ResultBean selectByCondition(@RequestBody QualityTestContent obj) {
		return qualityTestContentService.selectByCondition(obj);
	}
	
	@ApiOperation("查询实验内容不分页")
	@RequestMapping(value = "/getByTestNo/{testNo}",method = RequestMethod.GET)
	public ResultBean getByTestNo(@PathVariable String testNo){
		return qualityTestContentService.getByTestNo(testNo);
	}
	
}
